package com.kecheng.action;

import com.kecheng.dao.*;
import com.kecheng.pojo.*;
import org.apache.struts2.convention.annotation.Action;
import org.apache.struts2.convention.annotation.AllowedMethods;
import org.apache.struts2.convention.annotation.ParentPackage;
import org.apache.struts2.convention.annotation.Result;
import org.springframework.beans.factory.annotation.Autowired;

import java.io.File;
import java.io.UnsupportedEncodingException;
import java.util.*;

/**
 * 后台产品的增删改查
 * @author yunxin
 *
 */
@ParentPackage("json-default")
@Action(value = "product", results = {
		@Result(name = "allp", location = "/admin/product/allp.jsp"),
		@Result(name = "update", location = "/admin/product/update.jsp"),
		@Result(name = "skuclassify", location = "/admin/product/skuclassify.jsp"),
		@Result(name = "pList", location = "/w/pList.jsp"),
		@Result(name = "allp11", location = "/w/allp.jsp"),
		@Result(name = "classifyw", location = "/w/classify.jsp"),
		@Result(name = "allp22", location = "/w/allp1.jsp"),
		@Result(name = "search", location = "/w/search.jsp"),
		@Result(name = "pdetail", location = "/w/p.jsp"),
		@Result(name = "kucun",type = "json",params={"root","pstore"}),
		@Result(name = "allp1",type = "json",params={"root","products"}),
		@Result(name = "setchang",type = "json",params={"root","changyong"}),
		@Result(name = "search1",type = "json",params={"root","products"}),
		@Result(name = "allp2",type = "json",params={"root","products"}),
		@Result(name = "bianma",type = "json",params={"root","product"}),
		@Result(name = "skuclassify2",type = "json",params={"root","skuclassify2s"}),
		@Result(name = "skuclassify3",type = "json",params={"root","skuclassify3s"}),
		@Result(name = "skuclassify4",type = "json",params={"root","skuclassify4s"}),
		@Result(name = "fail", location = "/fail.jsp"),
		@Result(name = "id", location = "/w/p.jsp"),
})
@AllowedMethods(value = {("regex:.*")})
public class ProductAction extends BaseAction{

	private File file;
	private String fileFileName;
	private Product product;
	@Autowired
	private ProductDao productDao;
	private List<Product> products;
	private int id1;
	private int[] id;
	private Product product1;
	// ---------------------------

	private String[] guige1;//增加商品---规格排列组合形成的，第一个规格的规格值集合
	private String[] guige2;
	private String[] guige3;
	private String[] jilubianma;//用来表示某种规格的商品（）
	private int[] guige1id;//增加商品---规格排列组合形成的，第一个规格的规格值集合
	private int[] guige2id;
	private int[] guige3id;

	private double[] price;//价格
	private int[] stocknum;//库存
	private Pstore pstore;//根据规格各种组合来储存的记录
	@Autowired
	private PstoreDao pstoreDao;
	private List<Pstore> pstores;

	private List<Guige> guiges;
	private List<Guigevalue> guigevalues;
	@Autowired
	private GuigeDao guigeDao;
	@Autowired
	private GuigevalueDao guigevalueDao;
	private Guigevalue guigevalue;
	private Guige guige;
	private List list;// 规格和规格值
	private List guigevalueid;// 更新的产品已有的规格值

	private Skuclassify1 skuclassify1;//sku的分类
	private Skuclassify2 skuclassify2;
	private Skuclassify3 skuclassify3;
	private Skuclassify4 skuclassify4;
	private List<Skuclassify1> skuclassify1s;
	private List<Skuclassify2> skuclassify2s;
	private List<Skuclassify3> skuclassify3s;
	private List<Skuclassify4> skuclassify4s;
	@Autowired
	private Skuclassify1Dao skuclassify1Dao;
	@Autowired
	private Skuclassify2Dao skuclassify2Dao;
	@Autowired
	private Skuclassify3Dao skuclassify3Dao;
	@Autowired
	private Skuclassify4Dao skuclassify4Dao;
	@Autowired
	private PattrsaveDao pattrsaveDao;

	private Changyong changyong;
	private List<Changyong> changyongs;
	@Autowired
	private ChangyongDao changyongDao;

	private Map<Pattr, List<Attrvalue>> valuemap;// 扩展属性
	private Map<Guige, List<Guigevalue>> valuemap1;// 规格
	private List<Pattrsave> pattrsaves;
	private List<Pattr> pattrs;
	private List<Attrvalue> attrvalues;
	private PattrDao pattrDao;
	private AttrvalueDao attrvalueDao;

	private String[] attrname;// 扩展属性name
	private String[] attrvalue;
	private Pattrsave pattrsave;
	private Guige guige01;
	private Guige guige02;
	private Guige guige03;
	private int guigenum;// 判断总共有多少种规格传到页面
	private String name;


	// 模糊搜索
	public String sousuo() {
		products = productDao.serchLike(name);
		return "pList";
	}

	// sku的productaction--------------------

	// 点击添加商品跳转商品类目选择
	public String skuclassify() {
		skuclassify1s = skuclassify1Dao.findall();
		changyongs = changyongDao.findall();

		return "skuclassify";
	}

	public String skuclassify2() {
		skuclassify2s = skuclassify2Dao.findBySkuclassifyid1(skuclassify2
				.getSkuclassifyid1());
		// System.out.println(skuclassify2s.size());
		return "skuclassify2";
	}

	public String skuclassify3() {
		skuclassify3s = skuclassify3Dao.findBySkuclassifyid2(skuclassify3
				.getSkuclassifyid2());
		return "skuclassify3";
	}

	public String skuclassify4() {
		skuclassify4s = skuclassify4Dao.findBySkuclassifyid3(skuclassify4
				.getSkuclassifyid3());
		return "skuclassify4";
	}

	// 从add进入修改已选sku类目
	public String modifyhassku() {
		skuclassify1 = skuclassify1Dao.findById(skuclassify1.getId());
		skuclassify2 = skuclassify2Dao.findById(skuclassify2.getId());
		// System.out.println("skuclassify3的id"+skuclassify3.getId());
		if (skuclassify3 != null) {
			skuclassify3 = skuclassify3Dao.findById(skuclassify3.getId());
			skuclassify3s = skuclassify3Dao.findBySkuclassifyid2(skuclassify2
					.getId());
		}
		if (skuclassify4 != null) {
			skuclassify4 = skuclassify4Dao.findById(skuclassify4.getId());
			skuclassify4s = skuclassify4Dao.findBySkuclassifyid3(skuclassify3
					.getId());
		}
		// System.out.println("三级sku长度为："+skuclassify3s.size());
		skuclassify1s = skuclassify1Dao.findall();
		changyongs = changyongDao.findall();
		skuclassify2s = skuclassify2Dao.findBySkuclassifyid1(skuclassify1
				.getId());

		return "skuclassify";
	}

	// 设置常用类目
	public String setchang() {
		skuclassify1 = skuclassify1Dao.findById(changyong.getSkuoneid());
		changyong.setOnename(skuclassify1.getName());
		skuclassify2 = skuclassify2Dao.findById(changyong.getSkutwoid());
		changyong.setTwoname(skuclassify2.getName());
		if (changyong.getSkuthreeid() != 0) {
			skuclassify3 = skuclassify3Dao.findById(changyong.getSkuthreeid());
			changyong.setThreename(skuclassify3.getName());
		}
		if (changyong.getSkufourid() != 0) {
			skuclassify4 = skuclassify4Dao.findById(changyong.getSkufourid());
			changyong.setFourname(skuclassify4.getName());
		}
		changyongDao.add(changyong);
		return "setchang";
	}

	// 产品更新提交
//	public String update1() {
//		// System.out.println("jinlai0000");
//		Product p = productDao.findbyid(product.getId());
//		if (file == null) {
//			product.setImg(p.getImg());
//		} else {
//			product.setImg(compressFile(file, fileFileName, null));
//		}
//		classify = classifyDao.findbyid(product.getClassifyid());
//		product.setClassify(classify.getCname());
//		productDao.update(product);
//
//		if (p.getSpecification().equals("1")) {
//			// 把原来的pattrsave删掉，再从新存入
//			pattrsaves = pattrsaveDao.findbybianma(product.getBianma());
//			for (int i = 0; i < pattrsaves.size(); i++) {
//				pattrsaveDao.deletebyid(pattrsaves.get(i));
//			}
//			for (int i = 0; i < attrname.length; i++) {
//				// System.out.println("attrvalue是"+attrvalue[i]);
//				// 此处不用过滤没选的属性，直接以“选择”存入，这样方便跳转更新的时候，依次把已选的属性显示在页面对应的属性中。
//				// 这些属性在取用的时候在进行过滤，把没选的过滤掉
//				// if(!attrvalue[i].equals("选择")){
//				pattrsave = new Pattrsave();
//				pattrsave.setAttr(attrname[i]);
//				pattrsave.setBianma(product.getBianma());
//				pattrsave.setValue(attrvalue[i]);
//				pattrsaveDao.add(pattrsave);
//				// }
//			}
//
//			// 思路先把原来的pstore记录删掉，再从新存入
//			pstores = pstoreDao.findbybianma(product.getBianma());
//			for (int i = 0; i < pstores.size(); i++) {
//				pstoreDao.deletebyid(pstores.get(i));
//			}
//
//			for (int i = 0; i < guige1.length; i++) {
//				pstore = new Pstore();
//				pstore.setGuige1(guige1[i]);
//				pstore.setPrice(price[i]);
//				pstore.setStocknum(stocknum[i]);
//				pstore.setGuige1id(guige1id[i]);
//				pstore.setJilubianma(jilubianma[i]);
//				pstore.setBianma(product.getBianma());
//				// 上面直接把原来的全部删除，这里重新添加
//				if (guige2 != null) {
//					pstore.setGuige2(guige2[i]);
//					pstore.setGuige2id(guige2id[i]);
//				}
//				if (guige3 != null) {
//					pstore.setGuige3(guige3[i]);
//					pstore.setGuige3id(guige3id[i]);
//				}
//				pstoreDao.add(pstore);
//			}
//		}
//		return findall();
//	}

	// 跳转产品更新
	public String update() {
		product = productDao.findbyid(id1);
//		classifys = classifyDao.findall();
		guigevalueid = new ArrayList();
		// 根据产品最后一级的skuid来查规格和属性
		int someid;
		int skuclassifyid = product.getSkuclassfiyid4()==null?0:product.getSkuclassfiyid4();
		if (skuclassifyid == 0) {
			if (product.getSkuclassfiyid3() != 0) {
				skuclassifyid = product.getSkuclassfiyid3();
				someid = Integer.valueOf("3" + skuclassifyid);
				// System.out.println("三级skuid"+someid);
				skuclassify3 = skuclassify3Dao.findById(skuclassifyid);
				skuclassify2 = skuclassify2Dao.findById(skuclassify3
						.getSkuclassifyid2());
				skuclassify1 = skuclassify1Dao.findById(skuclassify2
						.getSkuclassifyid1());
				product.setSkuclassfiyname1(skuclassify1.getName());
				product.setSkuclassfiyname2(skuclassify2.getName());
				product.setSkuclassfiyname3(skuclassify3.getName());
			} else {
				skuclassifyid = product.getSkuclassfiyid2();
				someid = Integer.valueOf("2" + skuclassifyid);

				skuclassify2 = skuclassify2Dao.findById(skuclassifyid);
				skuclassify1 = skuclassify1Dao.findById(skuclassify2
						.getSkuclassifyid1());
				product.setSkuclassfiyname1(skuclassify1.getName());
				product.setSkuclassfiyname2(skuclassify2.getName());
			}

		} else {
			someid = Integer.valueOf("4" + skuclassifyid);
			skuclassify4 = skuclassify4Dao.findById(skuclassifyid);
			skuclassify3 = skuclassify3Dao.findById(skuclassify4
					.getSkuclassifyid3());
			skuclassify2 = skuclassify2Dao.findById(skuclassify3
					.getSkuclassifyid2());
			skuclassify1 = skuclassify1Dao.findById(skuclassify2
					.getSkuclassifyid1());

			product.setSkuclassfiyname1(skuclassify1.getName());
			product.setSkuclassfiyname2(skuclassify2.getName());
			product.setSkuclassfiyname3(skuclassify3.getName());
			product.setSkuclassfiyname4(skuclassify4.getName());
		}

		// 查规格
		guiges = guigeDao.findBySkuclassifyid(someid);
		valuemap1 = new TreeMap<Guige, List<Guigevalue>>(
				new Comparator<Guige>() {
					public int compare(Guige guige1, Guige guige2) {
						return guige1.getId().compareTo(guige2.getId());
					}
				});

		for (int i = 0; i < guiges.size(); i++) {
			guigevalues = guigevalueDao.findByGuigebianma(guiges.get(i)
					.getGuigebianma());
			valuemap1.put(guiges.get(i), guigevalues);
		}
		session.put("valuemap1", valuemap1);
		// 查属性
		pattrs = pattrDao.findBySkuclassifyid(someid);
		valuemap = new TreeMap<Pattr, List<Attrvalue>>(new Comparator<Pattr>() {
			public int compare(Pattr pattr1, Pattr pattr2) {
				return pattr1.getId().compareTo(pattr2.getId());
			}
		});
		for (int i = 0; i < pattrs.size(); i++) {
			attrvalues = attrvalueDao.findByAttrbianma(pattrs.get(i)
					.getAttrbianma());
			valuemap.put(pattrs.get(i), attrvalues);
		}
		session.put("valuemap", valuemap);

		// 规格存储记录
		pstores = pstoreDao.findbybianma(product.getBianma());
		for (int i = 0; i < pstores.size(); i++) {
			if (pstores.get(i).getGuige1id()!=null&&pstores.get(i).getGuige1id() != 0) {
				guigevalueid.add(pstores.get(i).getGuige1id());
			}
			if (pstores.get(i).getGuige2id()!=null&&pstores.get(i).getGuige2id() != 0) {
				guigevalueid.add(pstores.get(i).getGuige2id());
			}
			if (pstores.get(i).getGuige3id()!=null&&pstores.get(i).getGuige3id() != 0) {
				guigevalueid.add(pstores.get(i).getGuige3id());
			}
		}
		// 去掉重复的规格记录表中的规格值id
		for (int i = 0; i < guigevalueid.size(); i++) {
			for (int j = guigevalueid.size() - 1; j > i; j--) {
				if (guigevalueid.get(i).toString().equals(
						guigevalueid.get(j).toString())) {
					guigevalueid.remove(j);
				}
			}
		}
		session.put("guigevalueid", guigevalueid);
		session.put("pstores", pstores);

		// 属性的储存记录
		pattrsaves = pattrsaveDao.findbybianma(product.getBianma());
		// //System.out.println("属性的储存记录0"+pattrsaves.get(0));
		session.put("pattrsaves", pattrsaves);
		List<Pattrsave> pattrsaves0 = (List<Pattrsave>) session
				.get("pattrsaves");
		// System.out.println("属性的储存记录1"+pattrsaves0.size());

		return "update";
	}

	// 添加商品
//	public String add(){
//		// 生成编码
//		int r = (int) (1 + Math.random() * 100);// 随机数
//		String bianma = TimeUtil.getString("MMddHHmmss") + r;
//		product.setBianma(bianma);
//		classify = classifyDao.findbyid(product.getClassifyid());
//		twoClassify = twoClassifyDao.findbyid(product.getTwoClassifyId());
//		product.setClassify(classify.getCname());
//		product.setTwoClassify(twoClassify.getCname());
//		// 保存商品扩展属性
//		if (attrname != null) {
//			for (int i = 0; i < attrname.length; i++) {
//				// System.out.println("attrvalue是"+attrvalue[i]);
//				// 此处不用过滤没选的属性，直接以“选择”存入，这样方便跳转更新的时候，依次把已选的属性显示在页面对应的属性中。
//				// 这些属性在取用的时候在进行过滤，把没选的过滤掉
//				// if(!attrvalue[i].equals("选择")){
//				pattrsave = new Pattrsave();
//				pattrsave.setAttr(attrname[i]);
//				pattrsave.setBianma(bianma);
//				pattrsave.setValue(attrvalue[i]);
//				pattrsaveDao.add(pattrsave);
//				// }
//			}
//		}
//		// 保存多规格
//		if (product.getSpecification().equals("1")) {
//			for (int i = 0; i < guige1.length; i++) {
//				pstore = new Pstore();
//				pstore.setGuige1(guige1[i]);
//				pstore.setPrice(price[i]);
//				pstore.setStocknum(stocknum[i]);
//				pstore.setGuige1id(guige1id[i]);
//				pstore.setJilubianma(jilubianma[i]);
//				pstore.setBianma(product.getBianma());
//				// 上面直接把原来的全部删除，这里重新添加
//				if (guige2 != null) {
//					pstore.setGuige2(guige2[i]);
//					pstore.setGuige2id(guige2id[i]);
//				}
//				if (guige3 != null) {
//					pstore.setGuige3(guige3[i]);
//					pstore.setGuige3id(guige3id[i]);
//				}
//				pstoreDao.add(pstore);
//			}
//		}
//		 //保存图片
//		product.setImg(compressFile(file, fileFileName, null));
//		// System.out.println(product.getBianma());
//		try {
//			productDao.add(product);
//			classifys = classifyDao.findall();
//			msg = "添加成功";
//			return findall();
//		} catch (Exception e) {
//			e.printStackTrace();
//			msg = "添加失败";
//			return "fail";
//		}
//
//	}

	// 前台选择服装时检查库存
	public String findkucun() {
		String bianma = pstore.getBianma();
		String jilubianma = pstore.getJilubianma();
		pstore = pstoreDao.findbytwobianma(bianma, jilubianma);
		// System.out.println("哈喽"+pstore);
		return "kucun";
	}

	// 前台产品详情
	public String findbyid() {
		try {
			openid = getCookie("openid");
		}catch (UnsupportedEncodingException e){
			// TODO Auto-generated catch block
			e.printStackTrace();
		}
		team = teamDao.findbysellerid(openid);
		guigenum = 0;
		if(product==null)product = (Product) session.get("product");//加入购物车再次跳转产品详情的时候，product是放在session上的
		product = productDao.findbyid(product.getId());
		
		pattrsaves = pattrsaveDao.findbybianma(product.getBianma());
		if (product.getSpecification().equals("1")) {
			guigenum = 1;
			pstores = pstoreDao.findbybianma(product.getBianma());
			// 这里查询出有哪些使用了哪些规格以及对应的规格值
			if (pstores.size()>0){
				// System.out.println("ssssss"+pstores.get(0).getGuige1id());
				guigevalue = guigevalueDao.findById(pstores.get(0)
						.getGuige1id());
				// System.out.println("ssssss000"+guigevalue.getGuigebianma());
				guige01 = guigeDao.findbybianma(guigevalue.getGuigebianma());
				// System.out.println("ssssss111");
				if (pstores.get(0).getGuige2id()!=null&&pstores.get(0).getGuige2id() != 0) {
					guigenum = 2;
					guigevalue = guigevalueDao.findById(pstores.get(0)
							.getGuige2id());
					guige02 = guigeDao
							.findbybianma(guigevalue.getGuigebianma());
				}
				if (pstores.get(0).getGuige3id()!=null&&pstores.get(0).getGuige3id() != 0) {
					guigenum = 3;
					guigevalue = guigevalueDao.findById(pstores.get(0)
							.getGuige3id());
					guige03 = guigeDao
							.findbybianma(guigevalue.getGuigebianma());
				}
			}
			// System.out.println(guiges);
			// 储存guige1
			Set<String> set = new TreeSet<String>();// 新建一个set集合,这样可以删除重复的规格1的值
			for (Pstore p : pstores) {
				set.add(p.getGuige1());
				product.setStocknum(product.getStocknum() + p.getStocknum());
			}
			guige1 = set.toArray(new String[0]);
			// 储存guige2
			if (pstores.get(0).getGuige2id()!=null&&pstores.get(0).getGuige2id() != 0) {
				Set<String> set1 = new TreeSet<String>();// guige2的值
				for (Pstore p : pstores) {
					set1.add(p.getGuige2());
				}
				guige2 = set1.toArray(new String[0]);
			}
			// 储存guige3
			if (pstores.get(0).getGuige3id()!=null&&pstores.get(0).getGuige3id() != 0) {
				Set<String> set2 = new TreeSet<String>();// guige3的值
				for (Pstore p : pstores) {
					set2.add(p.getGuige3());
				}
				guige3 = set2.toArray(new String[0]);
			}
		}
		return "pdetail";
	}

	public String deleteone() {
		// System.out.println(product.getId());
		// 判断这个商品是否是多规格,把对应的规格和属性也删除掉
		product = productDao.findbyid(product.getId());
		delPGuige(product);
		productDao.delete(product);

		return findall();
	}

	public String delete() {
		if (id != null) {
			for (int i = 0; i < id.length; i++) {
				product = productDao.findbyid(id[i]);
				delPGuige(product);
				productDao.delete(product);
			}
		}
		return findall();
	}

	/**
	 * 删除商品时删除规格
	 */
	public void delPGuige(Product product){
		pattrsaves = pattrsaveDao.findbybianma(product.getBianma());
		for (int i = 0; i < pattrsaves.size(); i++) {
			pattrsaveDao.deletebyid(pattrsaves.get(i));
		}
		if (product.getSpecification().equals("1")) {
			pstores = pstoreDao.findbybianma(product.getBianma());
			for (int i = 0; i < pstores.size(); i++) {
				pstoreDao.deletebyid(pstores.get(i));
			}
		}
	}
	/**
	 * 后台查询一页商品
	 * 
	 * @return
	 */
	public String findall(){
		if (page == null)page = 1;
		try {
			allpage = productDao.findallpage();
			products = productDao.findall(page);
			if (allpage == 0)allpage = 1;

		} catch (Exception e) {
			msg = "查询失败";
			e.printStackTrace();
		}
		return "allp";
	}

	// get和set方法---------------------
	public Product getProduct() {
		return product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	public File getFile() {
		return file;
	}

	public void setFile(File file) {
		this.file = file;
	}

	public String getFileFileName() {
		return fileFileName;
	}

	public void setFileFileName(String fileFileName) {
		this.fileFileName = fileFileName;
	}

	public List<Product> getProducts() {
		return products;
	}

	public void setProducts(List<Product> products) {
		this.products = products;
	}


	public int getId1() {
		return id1;
	}

	public void setId1(int id1) {
		this.id1 = id1;
	}

	public int[] getId() {
		return id;
	}

	public void setId(int[] id) {
		this.id = id;
	}

	public void setAllpage(int allpage) {
		this.allpage = allpage;
	}


	public Product getProduct1() {
		return product1;
	}

	public void setProduct1(Product product1) {
		this.product1 = product1;
	}


	public String[] getGuige1() {
		return guige1;
	}

	public void setGuige1(String[] guige1) {
		this.guige1 = guige1;
	}

	public String[] getGuige2() {
		return guige2;
	}

	public void setGuige2(String[] guige2) {
		this.guige2 = guige2;
	}

	public String[] getGuige3() {
		return guige3;
	}

	public void setGuige3(String[] guige3) {
		this.guige3 = guige3;
	}

	public String[] getJilubianma() {
		return jilubianma;
	}

	public void setJilubianma(String[] jilubianma) {
		this.jilubianma = jilubianma;
	}

	public int[] getGuige1id() {
		return guige1id;
	}

	public void setGuige1id(int[] guige1id) {
		this.guige1id = guige1id;
	}

	public int[] getGuige2id() {
		return guige2id;
	}

	public void setGuige2id(int[] guige2id) {
		this.guige2id = guige2id;
	}

	public int[] getGuige3id() {
		return guige3id;
	}

	public void setGuige3id(int[] guige3id) {
		this.guige3id = guige3id;
	}

	public double[] getPrice() {
		return price;
	}

	public void setPrice(double[] price) {
		this.price = price;
	}

	public int[] getStocknum() {
		return stocknum;
	}

	public void setStocknum(int[] stocknum) {
		this.stocknum = stocknum;
	}

	public Pstore getPstore() {
		return pstore;
	}

	public void setPstore(Pstore pstore) {
		this.pstore = pstore;
	}

	public List<Pstore> getPstores() {
		return pstores;
	}

	public void setPstores(List<Pstore> pstores) {
		this.pstores = pstores;
	}

	public List<Guige> getGuiges() {
		return guiges;
	}

	public void setGuiges(List<Guige> guiges) {
		this.guiges = guiges;
	}

	public List<Guigevalue> getGuigevalues() {
		return guigevalues;
	}

	public void setGuigevalues(List<Guigevalue> guigevalues) {
		this.guigevalues = guigevalues;
	}

	public Guigevalue getGuigevalue() {
		return guigevalue;
	}

	public void setGuigevalue(Guigevalue guigevalue) {
		this.guigevalue = guigevalue;
	}

	public Guige getGuige() {
		return guige;
	}

	public void setGuige(Guige guige) {
		this.guige = guige;
	}

	public List getList() {
		return list;
	}

	public void setList(List list) {
		this.list = list;
	}

	public List getGuigevalueid() {
		return guigevalueid;
	}

	public void setGuigevalueid(List guigevalueid) {
		this.guigevalueid = guigevalueid;
	}

	public Skuclassify1 getSkuclassify1() {
		return skuclassify1;
	}

	public void setSkuclassify1(Skuclassify1 skuclassify1) {
		this.skuclassify1 = skuclassify1;
	}

	public Skuclassify2 getSkuclassify2() {
		return skuclassify2;
	}

	public void setSkuclassify2(Skuclassify2 skuclassify2) {
		this.skuclassify2 = skuclassify2;
	}

	public Skuclassify3 getSkuclassify3() {
		return skuclassify3;
	}

	public void setSkuclassify3(Skuclassify3 skuclassify3) {
		this.skuclassify3 = skuclassify3;
	}

	public Skuclassify4 getSkuclassify4() {
		return skuclassify4;
	}

	public void setSkuclassify4(Skuclassify4 skuclassify4) {
		this.skuclassify4 = skuclassify4;
	}

	public List<Skuclassify1> getSkuclassify1s() {
		return skuclassify1s;
	}

	public void setSkuclassify1s(List<Skuclassify1> skuclassify1s) {
		this.skuclassify1s = skuclassify1s;
	}

	public List<Skuclassify2> getSkuclassify2s() {
		return skuclassify2s;
	}

	public void setSkuclassify2s(List<Skuclassify2> skuclassify2s) {
		this.skuclassify2s = skuclassify2s;
	}

	public List<Skuclassify3> getSkuclassify3s() {
		return skuclassify3s;
	}

	public void setSkuclassify3s(List<Skuclassify3> skuclassify3s) {
		this.skuclassify3s = skuclassify3s;
	}

	public List<Skuclassify4> getSkuclassify4s() {
		return skuclassify4s;
	}

	public void setSkuclassify4s(List<Skuclassify4> skuclassify4s) {
		this.skuclassify4s = skuclassify4s;
	}

	public Changyong getChangyong() {
		return changyong;
	}

	public void setChangyong(Changyong changyong) {
		this.changyong = changyong;
	}

	public List<Changyong> getChangyongs() {
		return changyongs;
	}

	public void setChangyongs(List<Changyong> changyongs) {
		this.changyongs = changyongs;
	}

	public Map<Pattr, List<Attrvalue>> getValuemap() {
		return valuemap;
	}

	public void setValuemap(Map<Pattr, List<Attrvalue>> valuemap) {
		this.valuemap = valuemap;
	}

	public Map<Guige, List<Guigevalue>> getValuemap1() {
		return valuemap1;
	}

	public void setValuemap1(Map<Guige, List<Guigevalue>> valuemap1) {
		this.valuemap1 = valuemap1;
	}

	public List<Pattrsave> getPattrsaves() {
		return pattrsaves;
	}

	public void setPattrsaves(List<Pattrsave> pattrsaves) {
		this.pattrsaves = pattrsaves;
	}

	public List<Pattr> getPattrs() {
		return pattrs;
	}

	public void setPattrs(List<Pattr> pattrs) {
		this.pattrs = pattrs;
	}

	public List<Attrvalue> getAttrvalues() {
		return attrvalues;
	}

	public void setAttrvalues(List<Attrvalue> attrvalues) {
		this.attrvalues = attrvalues;
	}

	public String[] getAttrname() {
		return attrname;
	}

	public void setAttrname(String[] attrname) {
		this.attrname = attrname;
	}

	public String[] getAttrvalue() {
		return attrvalue;
	}

	public void setAttrvalue(String[] attrvalue) {
		this.attrvalue = attrvalue;
	}

	public Pattrsave getPattrsave() {
		return pattrsave;
	}

	public void setPattrsave(Pattrsave pattrsave) {
		this.pattrsave = pattrsave;
	}

	public Guige getGuige01() {
		return guige01;
	}

	public void setGuige01(Guige guige01) {
		this.guige01 = guige01;
	}

	public Guige getGuige02() {
		return guige02;
	}

	public void setGuige02(Guige guige02) {
		this.guige02 = guige02;
	}

	public Guige getGuige03() {
		return guige03;
	}

	public void setGuige03(Guige guige03) {
		this.guige03 = guige03;
	}

	public int getGuigenum() {
		return guigenum;
	}

	public void setGuigenum(int guigenum) {
		this.guigenum = guigenum;
	}

	public Integer getPage() {
		return page;
	}

	public void setPage(Integer page) {
		this.page = page;
	}

	public Integer getAllpage() {
		return allpage;
	}

	public void setAllpage(Integer allpage) {
		this.allpage = allpage;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}



}
